/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2024-01-13
 * Time:14:19
 */
public class Dog extends Animal{
    public String color;

//    Dog() {
//        super("Zhangsan",15);
//        this.color = "white";
//    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + super.name + '\'' +
                ", age=" + super.age +
                '}';
    }

    void bark() {
        System.out.println(name+"在汪汪叫");
    }

    @Override
    public void eat() {
        System.out.println(name+"在吃狗粮");
    }

    @Override
    public void method() {
        System.out.println("这是子类的method方法");
    }

    public void method1() {
        eat();
        super.eat();
    }

    public void method2() {
        method();
        super.method();
    }

    public static void main(String[] args) {
        Animal animal = new Dog();
        animal.name = "Huanhuan";
        animal.eat();
    }
}
